<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ page import="com.pignest.hotel.spring.Services" %><%@ page import="com.pignest.hotel.system.*" %><%@ page import="com.pignest.framework.util.Utils" %><%
String contextPath = request.getContextPath();
String url = Services.getAdminService().getLogUrl(request);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>系统日志</title>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/calendar.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/hotel.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/log.css"/>
<link type="text/css" rel="stylesheet" media="screen" href="<%=contextPath%>/css/flexigrid.css"/>
<script type="text/javascript" src="<%=contextPath%>/scripts/calendar/calendar.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/calendar/calendar-zh.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/calendar/calendar-setup.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="<%=contextPath%>/scripts/flexigrid.js"></script>
</head>

<body>
<div id="wrapper" class="gtable">
  <div style="margin-top: 0px;" id="caption">
    <div class="bg">
      <h1>系统日志</h1>
    </div>
  </div>
        <div id="content-wrapper">
            <div id="content">
                <div class="content">
                    <div id="tabs1">
<form action="log.jsp" method="get">
	<table cellspacing="0" cellpadding="0">
		<tr class="odd">
			<td width="60px" align="right">开始时间</td>
			<td>
				<input type="text" value="${param.startTime}" name="startTime" id="startTime" style="width:120px;ime-mode:disabled;"/>
				<input type="button" id="btn_stime" value="…"/>
			</td>
			<td  width="60px" align="right">结束时间</td>
			<td>
				<input type="text" value="${param.endTime}" name="endTime" id="endTime" style="width:120px;ime-mode:disabled;"/>
				<input type="button" id="btn_etime" value="…"/>
			</td>
			<td  width="60px" align="right">用户名</td>
			<td><input type="text" value="${param.userName}" name="userName" style="width:120px" maxlength="82"/></td>
			<td><input type="button" value="重设" onclick="javascript:$('form input:text').val('');" style="padding:3px 10px;"/></td>
		</tr>
		<tr class="even">
			<td align="right">IP地址</td>
			<td><input type="text" value="${param.ip}" name="ip" style="width:120px;ime-mode:disabled;" maxlength="15"/></td>
			<td align="right">关键字</td>
			<td colspan="3"><input type="text" value="${param.keyword}" name="keyword" style="width:428px" maxlength="82"/></td>
			<td><input type="submit" value="查询" style="padding:3px 10px;"/></td>
		</tr>
	</table>
</form>
                    </div><div id="tabs2" style="display: block;clear:true;">
                    		<table id="logTable" style="display:none"></table>
<!--<table id="logTable" border="1" cellspacing="0" cellpadding="10" width="100%">
	<thead>
	<tr class="header">
		<th width="10%" align="left">用户名</th>
		<th width="20%" align="left">时间</th>
		<th width="10%" align="left">IP地址</th>
		<th width="10%" align="left">动作</th>
		<th width="10%" align="left">类别</th>
		<th align="left">描述</th>
	</tr>
	</thead>
	<tbody>
	
	</tbody>
</table>
-->
				</div>
			</div>
		</div>
	</div>
	<div id="footer">
		<jsp:include page="/modules/global/inc/footer.jsp"></jsp:include>
	</div>
</div>
    
<script>
Calendar.setup({
    inputField     :    "startTime",
    ifFormat       :    "%Y-%m-%d %H:%M",
    showsTime      :    true,
    button         :    "btn_stime",
    singleClick    :    false,
    step           :    1
});
Calendar.setup({
    inputField     :    "endTime",
    ifFormat       :    "%Y-%m-%d %H:%M",
    showsTime      :    true,
    button         :    "btn_etime",
    singleClick    :    false,
    step           :    1
});

$(document).ready(function() {
	var tableHeight = $(document).height()-$("#tabs2").offset().top - 74;//224
	$("#logTable").flexigrid({
		url: '<%=url%>',
		dataType: 'json',
		colModel : [
			{display: '用户名', name : 'userName', width : 100, sortable : false, align: 'center'},
			{display: '时间', name : 'time', width : 140, sortable : false, align: 'center'},
			{display: 'IP地址', name : 'ip', width : 90, sortable : false, align: 'center'},
			{display: '动作', name : 'action', width : 95, sortable : false, align: 'left'},
			{display: '类别', name : 'category', width : 95, sortable : false, align: 'left'},
			{display: '描述', name : 'desc', width : 300, sortable : false, align: 'left'}
			],
//		searchitems : [],
//		sortname: "time",
//		sortorder: "desc",
		usepager: true,
		useRp: false,
		rp: 15,
		showTableToggleBtn: false,
		showToggleBtn: false,
		minheight: 30,
		resizable:false,
		pagestat: '第 {from} - {to} 条记录, 共 {total} 条',
		pagetext: '第',
		outof: '页, 共',
		totalpage: ' 页',
		nomsg: '没有找到相关记录',
		procmsg: '正在请求, 请稍等; 如果长时间没有反应, 请刷新',
		errormsg: '连接错误',
//		width: 700,
		height: tableHeight
	});
/**
	GlobalAjax.listLogs(null, null, null, null, null, 100, 0, function(data){
		if (data == null)
			return;
		data = $.parseJSON(data);
		if (data.iTotalRecords > 0 && data.aaData){
			$('#logTable').dataTable(data);
		}
	});
*/
} );
</script>
</body>
</html>
